//
//  CLChatOtherCell.m
//  CareLink
//
//  Created by 刘家强 on 16/8/21.
//  Copyright © 2016年 Seven Team. All rights reserved.
//

#import "CLChatOtherCell.h"

@interface CLChatOtherCell ()

@property (nonatomic, weak) UILabel *label;

@end

@implementation CLChatOtherCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString*)reuseIdentifier
{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setupUI];
    }
    return self;
}

- (void)setupUI{
    
    UIImageView *blackView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Dialog_green.right"]];
    [self addSubview:blackView];
    
    UIImageView *iconView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"user02_icon"]];
    iconView.layer.cornerRadius = 25;
    iconView.clipsToBounds = YES;
    
    [self addSubview:iconView];
    
    UILabel *label = [[UILabel alloc] init];
    label.numberOfLines = 0;
    
    [self addSubview:label];
    
    [iconView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.offset(20);
        make.right.offset(-20);
        make.height.width.offset(50);
        
//        make.top.offset(20);
//        make.right.offset(-20);
//        make.height.with.offset(50);
    }];
    
    [label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(iconView.mas_centerY).offset(-5);
        make.right.equalTo(iconView.mas_left).offset(-20);
        make.width.mas_lessThanOrEqualTo(200);
        make.bottom.equalTo(self).offset(-10);
    }];
    
    [blackView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(label).offset(-10);
        make.right.equalTo(label).offset(10);
        make.bottom.equalTo(label).offset(5);
    }];
    
    self.label = label;
    
}

- (void)setChatStr:(NSString *)chatStr {
    _chatStr = chatStr;
    
    self.label.text = self.chatStr;
    
    
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
